package com.dayatang.hrm.compensation.domain;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.dayatang.commons.domain.InstanceFactory;
import com.dayatang.hrm.staffing.domain.Employee;

/**
 * 浮动员工薪资参数记录
 * 
 * @author chencao
 * 
 */
@Entity
@Table(name = "pay_sp_record_floating_emp")
public class FloatingEmployeeSalaryParameterRecord extends
		SalaryParameterRecord {
	/**
	 * 
	 */
	private static final long serialVersionUID = -8063229308153402128L;

	private static FloatingEmployeeSalaryParameterRecordRepository floatingEmployeeSalaryParameterRecordRepository;

	// 浮动员工薪资参数(定义级)
	@ManyToOne
	@JoinColumn(name = "floating_employee_sp_id")
	private FloatingEmployeeSalaryParameter floatingEmployeeSalaryParameter;

	// 发生时间
	@Column(name = "occur_date")
	@Temporal(TemporalType.DATE)
	// @Index(name="OCCUR_DATE_IDX")
	private Date occurDate;
	// 关联的员工
	@ManyToOne
	@JoinColumn(name = "employee_id")
	private Employee employee;

	public FloatingEmployeeSalaryParameterRecord() {
	}

	static FloatingEmployeeSalaryParameterRecordRepository getFloatingEmployeeSalaryParameterRecordRepository() {
		if (floatingEmployeeSalaryParameterRecordRepository == null) {
			floatingEmployeeSalaryParameterRecordRepository = InstanceFactory
					.getInstance(FloatingEmployeeSalaryParameterRecordRepository.class);
		}
		return floatingEmployeeSalaryParameterRecordRepository;
	}

	static void setFloatingEmployeeSalaryParameterRecordRepository(
			FloatingEmployeeSalaryParameterRecordRepository floatingEmployeeSalaryParameterRecordRepository) {
		FloatingEmployeeSalaryParameterRecord.floatingEmployeeSalaryParameterRecordRepository = floatingEmployeeSalaryParameterRecordRepository;
	}

	public FloatingEmployeeSalaryParameter getFloatingEmployeeSalaryParameter() {
		return floatingEmployeeSalaryParameter;
	}

	public void setFloatingEmployeeSalaryParameter(
			FloatingEmployeeSalaryParameter floatingEmployeeSalaryParameter) {
		this.floatingEmployeeSalaryParameter = floatingEmployeeSalaryParameter;
	}

	public Date getOccurDate() {
		return occurDate;
	}

	public void setOccurDate(Date occurDate) {
		this.occurDate = occurDate;
	}

	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

}
